# Maintainer: Jelle van der Waa <jelle@archlinux.org>

pkgname=python-linetable
pkgver=0.0.3
pkgrel=1
pkgdesc='Library to parse and generate co_linetable attributes in Python code objects'
url="https://github.com/amol-/linetable"
arch=('any')
license=('MIT')
depends=('python')
checkdepends=('python-pytest')
makedepends=('python-setuptools')
source=(${pkgname}-${pkgver}.tar.gz::https://github.com/amol-/linetable/archive/refs/tags/${pkgver}.tar.gz)
sha256sums=('dad177fcf1a75669e78b12ae5b6a5e5478fc9a41ea9295960436102ae8ce4b0a')

build() {
	cd linetable-${pkgver}
	PYTHONPATH=. python3 setup.py build
}

check() {
	cd linetable-${pkgver}
	export PYTHONPATH="${PWD}"
	pytest tests
}

package() {
	cd linetable-${pkgver}
	python ./setup.py install --root="$pkgdir/" --optimize=1

	install -D -m644 LICENSE "$pkgdir/usr/share/licenses/${pkgname}/LICENSE"
}
